﻿using DevExpress.Blazor;
using DevExpress.ExpressApp.Blazor.Components.Models;
using System.Linq.Expressions;

namespace EasyXaf.Blazor.ColorPickers;

public class ColorPickerModel : ComponentModelBase
{
    public bool Password
    {
        get => GetPropertyValue<bool>();
        set => SetPropertyValue(value);
    }

    public string DisplayFormat
    {
        get => GetPropertyValue(string.Empty);
        set => SetPropertyValue(value);
    }

    public string ErrorMessage
    {
        get => GetPropertyValue<string>();
        set => SetPropertyValue(value);
    }

    public int MaxLength
    {
        get => GetPropertyValue<int>();
        set => SetPropertyValue(value);
    }

    public string InputId
    {
        get => GetPropertyValue<string>();
        set => SetPropertyValue(value);
    }

    public BindValueMode BindValueMode
    {
        get => GetPropertyValue<BindValueMode>();
        set => SetPropertyValue(value);
    }

    public object Value
    {
        get => GetPropertyValue<object>();
        set => SetPropertyValue(value);
    }

    public Action<object> ValueChanged
    {
        get => GetPropertyValue<Action<object>>();
        set => SetPropertyValue(value);
    }

    public bool HasValueChanged => HasPropertyValue(nameof(ValueChanged));

    public Expression<Func<object>> ValueExpression
    {
        get => GetPropertyValue<Expression<Func<object>>>();
        set => SetPropertyValue(value);
    }

    public bool HasValueExpression => HasPropertyValue(nameof(ValueExpression));

    public bool Enabled
    {
        get => GetPropertyValue<bool>(true);
        set => SetPropertyValue(value);
    }

    public bool ReadOnly
    {
        get => GetPropertyValue<bool>();
        set => SetPropertyValue(value);
    }

    public string NullText
    {
        get => GetPropertyValue<string>();
        set => SetPropertyValue(value);
    }

    public SizeMode? SizeMode
    {
        get => GetPropertyValue<SizeMode?>();
        set => SetPropertyValue(value);
    }

    public string Id
    {
        get => GetPropertyValue<string>();
        set => SetPropertyValue(value);
    }

    public string CssClass
    {
        get => GetPropertyValue<string>();
        set => SetPropertyValue(value);
    }
}
